home *** CD-ROM | disk | FTP | other *** search
/ Softwarová Záchrana 3 / Softwarova-zachrana-3.bin / Xteq X-Setup / xqdcXSP-Setup-EN.exe / {app} / plugins / XQ Logon Pictures.xpl < prev    next >
Text File  |  2001-01-21  |  3KB  |  105 lines

  1. "FILE"="Xteq Systems X-Setup Plugin 6.0"
  2. "TYPE"="3"
  3. "COUNT"="1"
  4. "UIPATH 1"="Startup/Shutdown\Startup\Windows 9x/ME\20) Boot Picture"
  5. "NAME"="Boot Picture"
  6. "LANGUAGE"="VBScript"
  7. "VERSION"="2.1"
  8. "OSVERSION"="10101"
  9. "TEXT 1"="Picture 1"
  10. "DATA 1"="Bitmap pictures (*.BMP)|*.bmp|System Files (*.SYS)|*.sys|All Files (*.*)|*.*"
  11. "DESCRIPTION 1"="This plug-in can be used to change the picture that is displayed when starting Windows."
  12. "DESCRIPTION 2"="Note: The picture should be 320x400 pixels with 256 colors. If the image is not in this format, then *no* image will be displayed on startup!"
  13. "DESCRIPTION 3"="If you have changed the picture using X-Setup and want the default picture back, leave the field blank but remember that this will DELETE your current logon picture."
  14. "COMMENT 1"="Bug fixes by Neil Turner (totalxs@hotmail.com)"
  15. "CONTACTURL"="http://www.xteq.com"
  16. "AUTHOR"="Xteq Systems"
  17. "COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
  18.  
  19. 'Called when the Plugin is started
  20. SUB Plugin_Initialize
  21. END SUB
  22.  
  23. 'Called when the Plugin should validate the Data the user has entered
  24. SUB Plugin_CheckData(ElementIndex)
  25. END SUB
  26.  
  27. 'Called when the Plugin should apply the changes
  28. SUB Plugin_Apply(ElementIndex,ElementSubIndex)
  29.  s=GetUIElement(1)
  30.  if len(s)>0 then
  31.     Call DoWork("LOGO.SYS","LOGO.XSB",s)
  32.  else
  33.     Call GetFileBack("LOGO.SYS","LOGO.XSB")    
  34.  end if
  35.  
  36.  Call Restart
  37. END SUB
  38.  
  39. 'Called when the Plugin is about to be removed from memory
  40. SUB Plugin_Terminate
  41. END SUB
  42.  
  43. 'User defined SUB's
  44. SUB GetFileBack(FileName,BackupFile)
  45.  s1="C:\" & FileName
  46.  s2="C:\" & BackupFile
  47.  
  48.  
  49.  'if backup exists, execute function
  50.  if FileExists(s2) then
  51.     Call FileSetAttribute(s1,"S-")
  52.     Call FileSetAttribute(s1,"R-")
  53.     Call FileSetAttribute(s1,"H-")
  54.     Call FileDelete(s1)
  55.    
  56.     Call FileCopy(s2,s1)
  57.  
  58.     MsgInformation "Original file restored!"
  59.  else
  60.     MsgError "Backup of original file not found, unable to restore it."
  61.  end if
  62.  
  63. END SUB
  64.  
  65. SUB DoWork(File1,BackupFile,NewFile)
  66.  s1="C:\" & File1
  67.  s2="C:\" & BackupFile
  68.  s3=NewFile
  69.  s4="C:\msdos.sys"
  70.  
  71.  'if backup exists, delete it
  72.  if FileExists(s2) then
  73.   Call FileSetAttribute(s2,"S-")
  74.   Call FileSetAttribute(s2,"R-")
  75.   Call FileSetAttribute(s2,"H-")
  76.   Call FileDelete(s2)
  77.  end if
  78.  
  79.  'make backup of current file
  80.  if FileExists(s1) then
  81.   Call FileSetAttribute(s2,"S-")
  82.   Call FileSetAttribute(s2,"R-")
  83.   Call FileSetAttribute(s2,"H-")
  84.   Call FileCopy(s1,s2)
  85.   Call FileDelete(s1)
  86.  end if
  87.  
  88.  'now copy new file to old file
  89.  Call FileCopy(s3,s1)
  90.  Call MsgInformation("The new logo has been set.")
  91.  
  92.  'Neil Turner's additions....
  93.  'fix msdos.sys so that logo will appear...
  94.  
  95.  if FileExists(s4) then
  96.   Call FileSetAttribute(s4,"S-")
  97.   Call FileSetAttribute(s4,"R-")
  98.   Call FileSetAttribute(s4,"H-")
  99.   Call IniWriteValue(s4,"Options","Logo","1") 
  100.   Call FileSetAttribute(s4,"S+")
  101.   Call FileSetAttribute(s4,"R+")
  102.   Call FileSetAttribute(s4,"H+")
  103.  end if
  104. END SUB
  105.